namespace Brjnk.GpxExplorer.WPF
{
    using System;
    using System.Windows;
    using System.Windows.Data;

    /// <summary>
    /// </summary>
    public class SizeDoubleConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var size = (Size)value;
            return size.Width;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double val = (double)value;
            return new Size(val, val);
        }
    }
}